package dd.view;

import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;

import dd.control.SignInButtonController;
import dd.model.Event;

public class SignInScreen extends JFrame {

	private JPanel contentPane;
	private JTextField userNameTextField;
	private JTextField passwordTextField;
	private JButton signInButton;
	
	Event event;
	/**
	 * Launch the application.
	 */
	

	/**
	 * Create the frame.
	 */
	public SignInScreen(Event event) {
		this.event = event;
		setTitle("Sign in");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 526, 343);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblSignIn = new JLabel("Sign in");
		lblSignIn.setFont(new Font("Tahoma", Font.PLAIN, 15));
		lblSignIn.setBounds(216, 42, 80, 31);
		contentPane.add(lblSignIn);
		
		JLabel lblUserName = new JLabel("User Name");
		lblUserName.setBounds(88, 115, 80, 14);
		contentPane.add(lblUserName);
		
		JLabel lblPassword = new JLabel("Password");
		lblPassword.setBounds(88, 173, 80, 14);
		contentPane.add(lblPassword);
		
		userNameTextField = new JTextField();
		userNameTextField.setBounds(202, 112, 169, 20);
		contentPane.add(userNameTextField);
		userNameTextField.setColumns(10);
		
		passwordTextField = new JTextField();
		passwordTextField.setBounds(202, 170, 169, 20);
		contentPane.add(passwordTextField);
		passwordTextField.setColumns(10);
		
		signInButton = new JButton("Sign in");
		signInButton.setBounds(182, 242, 114, 23);
		contentPane.add(signInButton);
		signInButton.addActionListener(new SignInButtonController(this, event));
	}
	
	public JTextField getUserNameTextField() {
		return userNameTextField;
	}
	
	public JTextField getPasswordTextField() {
		return passwordTextField;
	}
}
